//临时存储

export default {
	namespaced: true,

	state: {
		iconArr: [], //icon图标数组
		myownCount:{},
	},
	mutations: {
		SET_ICONARR(state, arr) {
			state.iconArr = arr
		},
		SET_OWN(state,ob){
			state.myownCount = ob;
		},
	},
	actions: {
		fetchFiles({ commit }) {
			const files = require.context("@/static/images", true, /\/icon\/\w+\.(png|jpg|jpeg|gif|svg)$/);
			const mIcon = {};
			files.keys().forEach(key => {
				let name = key.split('/').pop().replace(/\.\w+$/, '').toLowerCase()
				mIcon[name] = files(key);
			});
			
			commit('SET_ICONARR', mIcon);
		}


	}
}